#include "xthread_pool.hpp"
#include "work_thread.hpp"

#include <thread>
#include <chrono>
xthread_pool::xthread_pool(/* args */)
{
}

xthread_pool::~xthread_pool()
{
}
xthread_pool* xthread_pool::getInstance()
{
    static xthread_pool t;
    return &t;
}
void xthread_pool::init_thread(int thread_count)
{
    this->m_count = thread_count;
    for (unsigned int i = 0; i < thread_count; i++)
    {
        work_thread* work = new work_thread();
        work->start();
        threads.push_back(work); // 保存线程
        std::this_thread::sleep_for(std::chrono::microseconds(10));
    }
    
}